/*function getData(){
    var rows = [];
    for(var i=1; i<=800; i++){
        var amount = Math.floor(Math.random()*1000);
        var price = Math.floor(Math.random()*1000);
        rows.push({
            inv: 'Inv No '+i,
            date: $.fn.datebox.defaults.formatter(new Date()),
            name: 'Name '+i,
            amount: amount,
            price: price,
            cost: amount*price,
            note: 'Note '+i
        });
    }
    return rows;
}*/

function add_user(){
    window.parent.addTab("用户新增", "../user/user_add");
}

function searchSubmit(){
    $("#searchForm").submit();
}

function edit_user(){
    var obj=$("#user_table").datagrid('getSelected');
    //console.log($('#user_table').datagrid('getPager').data("pagination").options.pageNumber);
    if(obj==null){
        alert("请选择员工！");
        return;
    }
    var user_id=obj.user_id;
    var array=$("#searchForm").serialize();
    var pageNumber=$('#user_table').datagrid("options").pageNumber;
    window.parent.addTab("用户编辑","../user/user_edit?user_id="+user_id+"&page="+pageNumber+"&"+array);
}